/**
  ******************************************************************************
  * @author     Chris
  * @since      2024/6/18 21:59
  *
  * @file       pd_adc_ch.h
  * @brief      Header file of Xxx hardware driver.
  *
  * @note       This file contains the Xxx object declaration.
  *
  * @warning    None.
  ******************************************************************************
  * Change Logs:
  *   Date          Author       Notes
  *   2024/6/18     Chris        the first version
  *
  ******************************************************************************
  */


#ifndef JLC_SKY_ADC_CH_H
#define JLC_SKY_ADC_CH_H

#include "stm32f407xx.h"
#include "pd_gpio.h"
#include "drivers.h"

typedef struct ADCChDef ADCCh;

struct ADCChDef {
    GPIO **gpios;
    uint8_t gpioSize;

    uint32_t *ranks;
    uint8_t rankSize;

    uint32_t *channels;
    uint8_t chSize;

    void (*init)(ADCCh *this);
};

extern const struct ADCChannelClass {
    ADCCh *(*build)(GPIO **gpios, uint8_t gpioSize,
                        uint32_t *ranks, uint8_t rankSize,
                        uint32_t *channels, uint8_t chSize);
} ADCChBuilder;

#endif //JLC_SKY_ADC_CH_H
